print("YetAnotherWebKitBrowser..., version 0.0.5")

print("[*] Peforming import checks...")
try:
    import PyQt5
except Exception as e:
    print(e)
    print("[!] You seem to have PyQt5 missing. (pip install pyqt5)")
    exit(-1)
print("[OK] PyQt5 is installed.")
try:
    import easysettings
except Exception as e:
    print(e)
    print("[!] You seem to have EasySettings missing. (pip install easysettings)")
    exit(-1)
print("[OK] EasySettings is installed.")
print("[OK] Import check successful.")

print("[*] Preloading plugins...")
from nativePlugins.NativePlugins import init
init()
print("[DONE] Loaded plugins.")

print("[*] Running minor tweaks...")
import os
from PyQt5.QtCore import QCoreApplication
from PyQt5 import QtCore
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
os.environ["QTWEBENGINE_CHROMIUM_FLAGS"] = "--enable-gpu-rasterization --enable-accelerated-mjpeg-decode --enable-accelerated-video-decode --enable-accelerated-video-encode --enable-zero-copy --enable-accelerated-video --enable-smooth-scrolling --enable-zero-copy --ui-enable-zero-copy --enable-features=VaapiVideoDecoder"
QCoreApplication.setApplicationName("yawk.")
QCoreApplication.setApplicationVersion("0.0.5")
QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts, True)
print("[DONE] Running minor tweaks...")

from ui import yawkui